@section('content')
<div class="am-cf am-padding">
   <div class="am-fl am-cf">
      <a href="{{URL::route('product.category')}}"><strong class="am-text-primary am-text-lg">产品类别</strong></a> / <small>添加</small>
   </div>
</div>
<form class="am-form am-form-horizontal" id="categoryAddForm" name="categoryAddForm"
	method="post" action="{{URL::route('product.category.add')}}">
  <div class="am-form-group">
    <label for="doc-ipt-3" class="am-u-sm-2 am-form-label">名称</label>
    <div class="am-u-sm-5">
      <input type="text" id="name" name="name" placeholder="输入类别名称"
      	data-rules="required|max_length[32]" class="validate" data-display="名称">
    </div>
    <p class="am-u-sm-5 help-block"></p>
  </div>

  <div class="am-form-group">
    <label for="doc-ipt-pwd-2" class="am-u-sm-2 am-form-label">父类别</label>
    <div class="am-u-sm-5">
      <select name="parent_id">
         <option value="0">请选择</option>
         @foreach ($categorys as $parent)
            <option value="{{$parent->id}}">{{$parent->name}}</option>
         @endforeach
      </select>
    </div>
    <p class="am-u-sm-5 help-block"></p>
  </div>
  <div class="am-form-group">
    <label for="doc-ipt-pwd-2" class="am-u-sm-2 am-form-label">颜色</label>
    <div class="am-u-sm-5">
      <select name="color">
         <option value="">黑色</option>
         @foreach ($colors as $key => $value)
            <option value="{{$key}}">{{$value}}</option>
         @endforeach
      </select>
    </div>
    <p class="am-u-sm-5 help-block"></p>
  </div>
  <div class="am-form-group">
    <label for="order" class="am-u-sm-2 am-form-label">顺序</label>
    <div class="am-u-sm-5">
      <input type="text" id="order" name="order" placeholder="值越大则顺序在前"
      	data-rules="integer" class="validate" data-display="顺序">
    </div>
    <p class="am-u-sm-5 help-block"></p>
  </div>
  <div class="am-form-group">
    <div class="am-u-sm-10 am-u-sm-offset-2">
      <button type="submit" class="am-btn am-btn-primary">添加</button>
    </div>
  </div>
</form>
@stop


@section('script')
<script type="text/javascript">
$(function () {
	$("#categoryAddForm").validate();
});
</script>
@stop
